import 'package:boss/common/common.dart';
import 'package:boss/models/sku.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class PlusCommodityByFormFieldSkuRow extends StatelessWidget {
  final Sku sku;

  const PlusCommodityByFormFieldSkuRow({Key key, this.sku}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return DefaultTextStyle(
      style: TextStyleConstant().normal_1_24,
      textAlign: TextAlign.center,
      overflow: TextOverflow.ellipsis,
      child: Container(
        height: 90.w,
        alignment: Alignment.center,
        child: Row(
          children: <Widget>[
            Expanded(child: Text(sku.skuName)),
            Expanded(child: Text(AmountUtil.price2String(sku.skuPrice))),
            Expanded(child: Text(AmountUtil.price2String(Constant.isTakeout ? sku.skuOriginalPrice ?? sku.skuPrice
                : sku.skuMemberPrice ?? sku.skuPrice))),
          ],
        ),
      ),
    );
  }
}
